<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta http-equiv="Cache-Control" content="no-store"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>	
	<!-- 全局CSS -->
	<link href="<c:url value="/styles/global.css"/>" type="text/css" rel="stylesheet">
	<!-- 系统辅助JS -->
	<script src="<c:url value="/scripts/application.js"/>" type="text/javascript"></script>
	<!-- jquery基本库 -->
	<script src="<c:url value="/scripts/jquery.js"/>" type="text/javascript"></script>
	<!-- Ajax提交Form -->
	<script src="<c:url value="/scripts/jquery.form.js"/>" type="text/javascript"></script>
	<!-- Ajax Form Validation-->
	<script src="<c:url value="/scripts/jquery.validate.js"/>" type="text/javascript"></script>
	<script src="<c:url value="/scripts/additional-methods.js"/>" type="text/javascript"></script>
	<!-- JS日历 -->
	<script src="<c:url value="/scripts/My97DatePicker/WdatePicker.js"/>" type="text/javascript"></script>
	
	<script type="text/javascript" >
	jQuery(function() {
		// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="<c:url value="/scripts/images/loading.gif"/>" alt="loading..." /></div>')
			.css({position: "relative", top: "1em", left: "25em"})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		}); 
		
		//var container = $('div.container');
		
		var v = jQuery("#queryForm").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					success: showResponse
				});
			}
			//,errorContainer: container,
			//errorLabelContainer: $("ol", container),
			//wrapper: 'li'
		});
		
		jQuery("#reset").click(function() {
			v.resetForm();
		});
	});	
	
	function showResponse(responseText, statusText, xhr, $form){
		if(responseText != null && responseText == 'success'){
			parent.openAlert('保存成功');
			parent.closeDialog();
		}else
			parent.openAlert(responseText);
	}
	</script>
	
	<base href="<%=basePath%>">
	<rapid:block name="head"/>
</head>
<body>
	<rapid:block name="content"/>
	<!-- script>
		new Validation(document.queryForm,{onSubmit:true,onFormValidate : function(result,form) {
			var finalResult = result;
			
			//在这里添加自定义验证
			return disableSubmit(finalResult,'submitButton');
		}});
	</script>   -->
</body>
</html>	